<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
$this->breadcrumbs=array(
		'Перевод'
);
$this->menu=array(
		array('label'=>'Сохранить', 'url'=>'#', 'itemOptions' => array ('class' => 'saveForm' ) ),
);
?>

<h1>Перевод</h1>
<div class="form">
<?php if(Yii::app()->user->hasFlash('success')): ?>
	<div class="flash-success">
		<?php echo Yii::app()->user->getFlash('success'); ?>
	</div>
<?php endif; ?>
<?php if(Yii::app()->user->hasFlash('error')): ?>
	<div class="flash-error">
		<?php echo Yii::app()->user->getFlash('error'); ?>
	</div>
<?php endif; ?>
<?php $form=$this->beginWidget('CActiveForm'); ?>
	
	<p class="note">Поля с <span class="required">*</span> должны быть заполнены.</p>
	<div class="tabs">
		<?php foreach(Yii::app()->params->languages as $key => $value): ?>
			<a href="#tab_<?php echo $key; ?>" class="tab <?php echo $key==0 ? 'active' : ''?>"><?php echo $key; ?></a>
		<?php endforeach;?>
	</div>
	<?php foreach($model as $key => $ln):?>
		<div id="tab_<?php echo $key; ?>" class="screen <?php echo $key==0 ? 'visible' : ''; ?>">
		<?php foreach($ln as $keyword => $value): ?>
			<?php $i = isset($i) ? $i+1 : 1 ;?>
			<div class="row">
				<label class="required" for="<?php echo 'el'.$i;?>" >
					<?php echo $keyword; ?> 
					<span class="required">*</span>
				</label>
				<?php if(strlen($value)<75):?>
					<input type="text" id="<?php echo 'el'.$i;?>" name="<?php echo $key.'[el'.$i.']';?>" value="<?php echo $value;?>"/>
				<?php else: ?>
					<textarea id="<?php echo 'el'.$i;?>" name="<?php echo $key.'[el'.$i.']';?>" rows="5"><?php echo $value;?></textarea>
				<?php endif; ?>
			</div>
		<?php endforeach;?>
		</div>
	<?php endforeach;?>

<?php $this->endWidget(); ?>

</div><!-- form -->
